home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1524 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: lyra.csx.cam.ac.uk!93heb
  2. From: 93heb@eng.cam.ac.uk (H.E. Butterworth)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ATTENTION C EXPERTS!! Extern Declarations - NEED HELP!
  5. Date: 15 Jan 1996 11:49:39 GMT
  6. Organization: Cambridge University Engineering Department, UK
  7. Message-ID: <4ddf0j$6mb@lyra.csx.cam.ac.uk>
  8. References: <4dcl71$94s@enterprise.sct.gu.edu.au>
  9. NNTP-Posting-Host: tw800.eng.cam.ac.uk
  10.  
  11. Hi,
  12.  
  13.     IMHO
  14.  
  15.     cdecl and near are compiler flags which tell the compiler to use the c style
  16. calling convention (as opposed to pascal style) and that the function is near i.e.
  17. not to reload the segment registers on function entry.  The macros _CDECL and
  18. _NEAR just allow you to remove the flags by defining NO_KEYS.
  19.  
  20.     I have seen these before only in code for the segmented x86 memory model -
  21. specifically in exported sections of 16 bit Windows DLLs where an exported
  22. function must be declared far and cdecl - I think the compiler would otherwise
  23. use the pascal calling convention because it is slightly more efficient.  16 bit
  24. Windows code has this stuff scattered all over it.
  25.  
  26.     This may be a somewhat garbled version of 'The Truth' but I'm fairly sure
  27. it's on the right lines.
  28.  
  29. HB.
  30.